package com.zyl.pts.service.serviceImpl;

import com.zyl.pts.service.UploadService;
import com.zyl.pts.utils.OssUtil;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * @version v1.0
 * @ProjectName: product_source
 * @Package: com.zyl.pts.service.serviceImpl
 * @ClassName: UploadServiceImpl
 * @Description TODO()
 * @Author 翟玉龙
 * @Date 2024/11/20-15:22
 */
@Service
public class UploadServiceImpl implements UploadService {

    private final OssUtil ossUtil;

    public UploadServiceImpl(OssUtil ossUtil) {
        this.ossUtil = ossUtil;
    }

    /**
     * 文件上传
     * @param file 上传的文件
     * @return {@link String }
     */
    @Override
    public String upload(MultipartFile file) {
        return ossUtil.uploadOss(file);
    }
}
